/****************************************************/
 
/* Project Name:房间信息管理                              */
 
/* File Name:TdcRoomService            */
 
/* Date:2017年3月22日下午19:30:12            */
 
/* Description:房间信息的service的方法层       */
 /****************************************************/ 
package com.thinkgem.jeesite.modules.tdc.room.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.tdc.room.entity.TdcRoom;
import com.thinkgem.jeesite.modules.tdc.room.dao.TdcRoomDao;

/**
 * 房间信息Service
 * @author 孙瑞曦
 * @version 2017-03-20
 */
@Service
@Transactional(readOnly = true)
public class TdcRoomService extends CrudService<TdcRoomDao, TdcRoom> {

	@Autowired
	private TdcRoomDao tdcRoomDao;
	
	public TdcRoom get(String id) {
		return super.get(id);
	}
	
	/**
	 * 更改所有房间的状态为“空闲中”
	 */
	@Transactional(readOnly = false)
	public boolean allStatusReset(){
		System.out.println("service 01");
	return	tdcRoomDao.resetAllStatus();
	}
	
	public List<TdcRoom> findList(TdcRoom tdcRoom) {
		return super.findList(tdcRoom);
	}
	
	public Page<TdcRoom> findPage(Page<TdcRoom> page, TdcRoom tdcRoom) {
		page.setPageSize(10);
		return super.findPage(page, tdcRoom);
	}
	
	@Transactional(readOnly = false)
	public void save(TdcRoom tdcRoom) {
		super.save(tdcRoom);
	}
	
	@Transactional(readOnly = false)
	public void delete(TdcRoom tdcRoom) {
		super.delete(tdcRoom);
	}
	
}